<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<div class="box">
			<span>不喜欢写代码的程序员不是好程序员</span>
			<input type="" name="" id="" value="" />
			<input type="checkbox" name="" id="" value="" />
			<img src="img/timg.jpeg"/>
		</div>
	</body>
</html>

<style type="text/css">
	.box {
		border: 1px solid red;
	}
	/*设置垂直对齐的参照物*/
	.box:after {
		content: '';
		display: inline-block;
		height: 100%;
		/*vertical-align: middle;*/
	}
	/* 给box所有的子元素设置垂直对齐方式为middle */
	.box>* {
		vertical-align: middle;
	}
	.box input {
		height: 30px;
	}
	img {
		height: 50px;
	}
</style>
